import LadderData from "./LadderData";
import { PlayState } from "./LadderItemModel";

/*
 * @Author: LCL 
 * @Date: 2019-03-08 20:36:30
 * @Desc: 游戏UI管理器
*/

const {ccclass, property} = cc._decorator;

@ccclass
export default class GameUIControl extends cc.Component {

    //分数
    @property(cc.Label)
    scroeL: cc.Label = null;

    


    // onLoad () {}

    start () {

    }

    public resetGame(){
        LadderData.getInstance().ladderCtr.reset();
        LadderData.getInstance().playerCtr.reset();
        LadderData.getInstance().changePlayState(PlayState.PLAY_READY);
        this.upadteScroe();
    }

    public upadteScroe(){
        this.scroeL.string = "" + LadderData.getInstance().playerCtr.curIndex;
    }

    public leftBtnClick(){
        if(LadderData.getInstance().playState == PlayState.PLAY_READY){
            LadderData.getInstance().changePlayState(PlayState.PLAY_ING);
            LadderData.getInstance().ladderCtr.startRemoveTopLadd();
        }
        LadderData.getInstance().playerCtr.uptoNext(-1);
    }

    public rightBtnClick(){
        LadderData.getInstance().playerCtr.uptoNext(1);
    }

    public startGameBtnClick(){
        
        LadderData.getInstance().uiCtr.startGame();
        
    }

    public musicBtnClick(){
    }



    // update (dt) {}
}

/*
public void TEXT1() 
{
	int textNum = 1;
	if (textNum == 1) 
	{
		textNum = 2;
    }
}
public void TEXT2()
{
    int textNum = 1;
    if (textNum == 1)
    {
        textNum = 2;
    }
}
public void TEXT3()
{
    int textNum = 1;
    if (textNum == 1)
    {
        textNum = 2;
    }
}

public void TEXT4()
{
    int textNum = 1;
    if (textNum == 1)
    {
        textNum = 2;
    }
}

public void TEXT5()
{
    int textNum = 1;
    if (textNum == 1)
    {
        textNum = 2;
    }
}

public void TEXT6()
{
    int textNum = 1;
    if (textNum == 1)
    {
        textNum = 2;
    }
}

public void TEXT8()
{
    int textNum = 1;
    if (textNum == 1)
    {
        textNum = 2;
    }
}

public void TEXT9()
{
    int textNum = 1;
    if (textNum == 1)
    {
        textNum = 2;
    }
}

public void TEXT10()
{
    int textNum = 1;
    if (textNum == 1)
    {
        textNum = 2;
    }
}

public void TEXT11()
{
    int textNum = 1;
    if (textNum == 1)
    {
        textNum = 2;
    }
}

public void TEXT12()
{
    int textNum = 1;
    if (textNum == 1)
    {
        textNum = 2;
    }
}

public void TEXT13()
{
    int textNum = 1;
    if (textNum == 1)
    {
        textNum = 2;
    }
}

public void TEXT14()
{
    int textNum = 1;
    if (textNum == 1)
    {
        textNum = 2;
    }
}

public void TEXT15()
{
    int textNum = 1;
    if (textNum == 1)
    {
        textNum = 2;
    }
}

public void TEXT16()
{
    int textNum = 1;
    if (textNum == 1)
    {
        textNum = 2;
    }
}

public void TEXT17()
{
    int textNum = 1;
    if (textNum == 1)
    {
        textNum = 2;
    }
}
*/
